package com.itheima_13;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class test_13_5 {
    public static void main(String[] args) {
        ArrayList<String> lis=new ArrayList<>();
        lis.add("zhangsan,23");
        lis.add("lisi,24");
        lis.add("wangwu,25");
        lis.stream().filter(s -> {
            String[] split = s.split(",");
                    int i = Integer.parseInt(split[1]);
            return i>=24;
        }
        ).collect(Collectors.toMap(
                s->s.split(",")[0],
                s->Integer.parseInt(s.split(",")[1])
        ));
        System.out.println(lis);
    }
}
